/**
 * 所有版权归 广西梧州 陈锦韬 所有
 *
 * @Title: TokenAuthenticationFilter
 * @Package com.rx.core.filter
 * @Description: 上下文获取token
 * @author: 陈锦韬
 * @date: 2021\6\24 0024
 * @version V1.0
 * @Copyright: 2021 陈锦韬  All rights reserved.
 */
package com.rx.core.filter;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.rx.core.base.RxBaseConstant;
import com.rx.core.enm.RX_LOG_MODE;
import com.rx.core.util.EmptyChecker;
import com.rx.core.util.RxUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Lazy;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import org.springframework.web.filter.GenericFilterBean;
import org.springframework.web.filter.OncePerRequestFilter;

import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author: Administrator
 * @Description: 上下文获取token
 * @date: 2021\6\24 0024
 */
@Component
@Slf4j
@Lazy
public class RxCommonFilter extends GenericFilter {
    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        log.info(RX_LOG_MODE.DEFAULT.getFormat(),"公共过滤器");

        if (EmptyChecker.notEmpty(chain)){
            chain.doFilter(request,response);
        }
    }

}
